/**
 * @param {number[]} nums
 */
var Solution = function (nums) {
  this.nums = nums;
};

/**
 * @return {number[]}
 */
Solution.prototype.reset = function () {
  return this.nums;
};

/**
 * @return {number[]}
 */
Solution.prototype.shuffle = function () {
  let numbers = JSON.parse(JSON.stringify(this.nums));
  for (let i = 1; i < numbers.length; i++) {
    let index = Math.floor(Math.random() * (i + 1));
    swap(numbers, i, index);
  }
  return numbers;
};

function swap(arr, i, j) {
  let temp = arr[i];
  arr[i] = arr[j];
  arr[j] = temp;
}


/**
 * Your Solution object will be instantiated and called as such:
 * var obj = new Solution(nums)
 * var param_1 = obj.reset()
 * var param_2 = obj.shuffle()
 */

let nums = [
  [
    [1, 2, 3]
  ],
  [],
  [],
  []
];
